#pragma once
#ifndef __GLF_DEBUGGER_FILE_SYSTEM_H__
#define __GLF_DEBUGGER_FILE_SYSTEM_H__

#include <glf/config.h>

#if GLF_ENABLE_DEBUGGER

#include <glf/debugger/debugger.h>
#include <vector>

namespace glf
{
namespace debugger
{

class FileSystem : public Module
{
public:

	
	virtual ~FileSystem();

	virtual void UpdateFrame();
	virtual void Parse(int type, PacketReader& in);

private:
	FileSystem();

	enum SynchronizationState
	{
		E_DRSST_SYNCHRONIZE_REQUEST,
		E_DRSST_SYNCHRONIZING,
		E_DRSST_DONE,

		E_DRSST_COUNT
	};


	enum MessageType
	{
		// Debugger to Glf
		MESSAGE_REQUEST_SYSTEM_TIME,
		MESSAGE_REQUEST_FILE_ENTRIES,
		MESSAGE_FILE_CONTENT,
		MESSAGE_RESOURCES_SYNCHRONIZED,
		MESSAGE_REMOVE_FILE,
		MESSAGE_COPY_ALL_RESOURCES,
		MESSAGE_REQUEST_SYNCHRONIZE_RESOURCES,

		// Glf to Debugger
		MESSAGE_SYSTEM_TIME,
		MESSAGE_FILE_ENTRIES,
		MESSAGE_START_SYNCHRONIZE_RESOURCES
		
	};

	//void InitResourceSynchronization(bool showPopup = true);
	//void SetSynchronizationFolders(const char* pcResourceFolder, const char* deviceResourceFolder, const char* deviceSaveFolder);
	//bool GetSynchronizedFileName(const char* fileName, char* outFileName, uint outBufferSize);
	//bool SynchronizeFiles(uint timeOutSeconds);
	//void CopyResourcesToSaveFolder();
	//void SendFileEntries(const stringdbg& folder);
	//void CopyFiles(const stringdbg& srcFolder, const stringdbg& destFolder);

	// file system synchronization
	stringdbg mFileSystemSaveFolder;
	stringdbg mFileSystemPCResourceFolder;
	stringdbg mFileSystemDeviceResourceFolder;
	SynchronizationState mResourceSynchronizationState;
};

} // end namespace debugger
} // end namespace glf

#endif // GLF_ENABLE_DEBUGGER

#endif // __GLF_DEBUGGER_FILE_SYSTEM_H__
